package com.zrrd.blog.api.feign;

import com.zrrd.blog.api.entities.SysMenu;
import com.zrrd.blog.api.entities.SysUser;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "system-server",path = "/system")
public interface IFeignSystemController {
    @ApiOperation("feign接口，通过用户名查询用户信息")
    @ApiImplicitParam(name = "username",value = "用户名",required = true)
    @GetMapping("/api/feign/user/{username}")
    SysUser findUserByUsername(@PathVariable("username") String username);

    @ApiOperation("feign接口，通过用户id查询用户权限")
    @ApiImplicitParam(name = "userId",value = "用户id",required = true)
    @GetMapping("/api/feign/menu/{userId}")
    List<SysMenu> findMenuListByUserIdForLogin(@PathVariable("userId") String userId);

}
